
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2252. -- [2010Beijing wc]矩阵距离  -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2252: [2010Beijing wc]矩阵距离 </h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>256 MB<br><span class=green>Submit: </span>113&nbsp;&nbsp;<span class=green>Solved: </span>66<br>[<a href='submitpage.php?id=2252'>Submit</a>][<a href='problemstatus.php?id=2252'>Status</a>][<a href='bbs.php?id=2252'>Discuss</a>]</center><h2>Description</h2><div class=content><p>&nbsp;</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt"><font size="3"><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">假设我们有矩阵</span><span lang="EN-US"><font face="Times New Roman">,</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">其元素值非零即</span><span lang="EN-US"><font face="Times New Roman">1<o:p></o:p></font></span></font></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt"><span lang="EN-US"><font size="3"><font face="Times New Roman">a11&hellip;&hellip; a<st1:chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="1" unitname="m">1m</st1:chmetcnv><o:p></o:p></font></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman" size="3">&hellip;&hellip;&hellip;&hellip;&hellip;.</font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt"><span lang="EN-US"><font size="3"><font face="Times New Roman">an1&hellip;&hellip;.anm<o:p></o:p></font></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&nbsp;</font></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt"><font size="3"><span lang="EN-US"><font face="Times New Roman"></font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义</span><span lang="EN-US"><font face="Times New Roman">aij</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">与</span><span lang="EN-US"><font face="Times New Roman">akl</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之间的距离为</span><span lang="EN-US"><font face="Times New Roman">D(aij,akl)=abs(i-k)+abs(j-L) <o:p></o:p></font></span></font></p></div><h2>Input</h2><div class=content><p class="MsoNormal" style="margin: 0cm 0cm 0pt"><font size="3"><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">输入文件的第一行为两个整数，分别代表n和m。 <br />
接下来的n行，第i行的第 j个字符代表aij<br />
</span></font></p></div><h2>Output</h2><div class=content><p>输出包含N行，每行M个用空格分开的数字，其中第i行第J个数字代表<br />
Min(D(aij,axy) 1&lt;=x&lt;=N 1&lt;=y&lt;m,且axy=1</p></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>3 4 <br />
0001 <br />
0011 <br />
0110 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>3 2 1 0 <br />
2 1 0 0 <br />
1 0 0 1 </span></div><h2>HINT</h2>
			<div class=content><p><p>对于100%的数据，满足 0 &lt;  m n&nbsp;&lt;=1000</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search='></a></p></div><center>[<a href='submitpage.php?id=2252'>Submit</a>][<a href='problemstatus.php?id=2252'>Status</a>][<a href='bbs.php?id=2252'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
